#pragma once
#include "CarAgent.h"
#include "Fare.h"
#include "Env.h"
#include "Dijkstras.h"
#include "Utils.h"

class CTaxiAgent :
    public CCarAgent
{
public:
    CTaxiAgent(int id, CNode* node, COLORREF color, CEnv* env);
    ~CTaxiAgent(void);
    virtual bool Step(CEnv* env, int ms);

    bool OnJob() { return m_onJob; }
    bool HasJob() { return m_hasJob; }

    // Statistics
    double m_cash;
    int m_faresCompleted;
    double m_profitRate;
    CSysTime m_birth;

private:
    CNodePtrVec m_nodes;
    CDijkstras* m_dijk;
    bool m_onJob;
    bool m_hasJob;
    CFare* m_fare;
    int m_senseRadius; 
    CStdioFile m_log;  

    void JobComplete(CEnv* env);
    bool GetNextJob(CEnv* env);
    void StartJob(CEnv* env);
    void TranslateFare();
};
